package pers.liyan.shi.springcloud.producerticketcore.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pers.liyan.shi.springcloud.producerticketcore.domain.Ticket;
import pers.liyan.shi.springcloud.producerticketcore.service.TicketService;

/**
 * TicketController
 *
 * @author shily
 * @date 2019/4/21 0:23
 */
@RestController
@RequestMapping("/ticket")
public class TicketController {

    @Autowired
    private TicketService ticketService;

    /**
     * 买票
     *
     * @param movieName 电影名称
     * @return pers.liyan.shi.springcloud.producerticketcore.domain.Ticket
     * @author shily
     * @date 2019/4/21 0:44
     */
    @GetMapping()
    public Ticket buyTicket(@RequestParam("movieName") String movieName) {
        return this.ticketService.buyTicket(movieName);
    }

}
